# -*- coding: utf-8 -*-
# Configures your navigation
SimpleNavigation::Configuration.run do |navigation|
  navigation.items do |primary|
    primary.dom_id = "top-menu"

    primary.item :home, t('menu.home'), root_path

    primary.item :documents, "Материалы", "#", :class => "dropdown" do |doc|
      doc.item :news,         t('menu.news'), documents_news_index_path, :highlights_on => :subpath
      doc.item :conferences,  t('menu.conferences'), documents_conferences_path, :highlights_on => :subpath
      doc.item :publications, t('menu.publications'), documents_publications_path, :highlights_on => :subpath
      doc.item :articles,     t('menu.articles'), documents_articles_path, :highlights_on => :subpath
    end

    primary.item :dictionary, t('menu.dictionary'), terms_path

    if user_signed_in? && current_user.administrator?
      primary.item :admin, "Администрирование", "#", :class => "dropdown" do |secondary|
        secondary.item :users, "Пользователи", admin_users_path, :highlights_on => :subpath
        secondary.item :mailing, "Рассылки", admin_mailing_index_path, :highlights_on => :subpath
      end
    end
  end
end
